﻿IF (EXISTS(SELECT id from sysobjects where id=object_id('usp_searchCandidatesByConstituency')))
	DROP PROCEDURE [dbo].[usp_searchCandidatesByConstituency]
GO

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

create procedure usp_searchCandidatesByConstituency
@DistrictId as nvarchar(50),
@PanchayatId as nvarchar(50),
@WardId as nvarchar(50),
@ElectionId as nvarchar(50)


as

select c.*,v.* from TblCandidate c, TblVoter v where 
c.voterid=v.voterid and
c.DistrictId= @DistrictId and
c.PanchayatId=@PanchayatId and
c.WardId=@WardId 
--and
--c.ElectionId=@ElectionId
